UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7EMpWj49TM4O6/7ea5ONFXkTyfWyYJ2lqCKWE+m1Mko='
WHERE
key_id = 'a36302567e0130f23ca2ebfdbbe8796c9344596363624d7c1d5b5636e7b302c5'
AND (
token = '7EMpWj49TM4O6/7ea5ONFXkTyfWyYJ2lqCKWE+m1Mko='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)