UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QezwU8HKZ7CMNulE/RFbrVJqSI6Z46g+I2S0GRqjm6k='
WHERE
key_id = '159e3bc4a4ca2b7c59749404923f988c1e1b4b7d59ef894162d21c8f157690d8'
AND (
token = 'QezwU8HKZ7CMNulE/RFbrVJqSI6Z46g+I2S0GRqjm6k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)