UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P53c34ekzQPnwI0qAvF+QcB5W+FfEOXIYjfHHHWORt8='
WHERE
key_id = '5b22cf5ac4631ccaed7530691205d694b49f349787a937bba85cf736613f93af'
AND (
token = 'P53c34ekzQPnwI0qAvF+QcB5W+FfEOXIYjfHHHWORt8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)