UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1MSHMEah24Yi8B1REQ4d3uAHVGpEyf3PKEaNjjIE9Ag='
WHERE
key_id = '0f32f6c44223fea08b6c88d9ef6abb97c0158b54683643efb85549cab39b728b'
AND (
token = '1MSHMEah24Yi8B1REQ4d3uAHVGpEyf3PKEaNjjIE9Ag='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)