UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LH4V1rtJKfFPtWFZMnpNBKNxv1Ux4dveUhKgxhB3lUw='
WHERE
key_id = 'f9e60ca2cab7964824119958b92fed8fd3a93cb3c57b56226e1a3eef8528b3e7'
AND (
token = 'LH4V1rtJKfFPtWFZMnpNBKNxv1Ux4dveUhKgxhB3lUw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)