UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lE0hB7uudsq/erzpyqVGAImEt9ddMuWkNZczYa0zxcg='
WHERE
key_id = '0be3a95a13b95e51022bc527a8b3581c0e6bf00be61b2bb4ce76a79651f418d0'
AND (
token = 'lE0hB7uudsq/erzpyqVGAImEt9ddMuWkNZczYa0zxcg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)