UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1AnMoABTJ6v/Re2MEgepeA0JyJkmSTKmXHzq8F5P2vs='
WHERE
key_id = '3377bf84c017c9f51bada6e173d13415e9214ecd5eeff5230576a4380759e45a'
AND (
token = '1AnMoABTJ6v/Re2MEgepeA0JyJkmSTKmXHzq8F5P2vs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)