UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2mYE8KJfQAnDnWin/uMBRBqfyL2GNKx6bA78Pw75/b8='
WHERE
key_id = 'be76afcd2f0ae7a5532fe9f7787a9d28dd8775eb90a0ba769646f186a60443b2'
AND (
token = '2mYE8KJfQAnDnWin/uMBRBqfyL2GNKx6bA78Pw75/b8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)