UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '43DilbxZSHJRkECj90iqipN/GkvqqjtUjM8Z4W8Jjc8='
WHERE
key_id = '3e480789506b6500286369185ad0063acaefaae06a18dd88690927b60f34bb24'
AND (
token = '43DilbxZSHJRkECj90iqipN/GkvqqjtUjM8Z4W8Jjc8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)