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