UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uUZYGOWd1WoTs5A1WqWXYUUOa0pa5dyM2kK9My1NmS4='
WHERE
key_id = '625265e1db660f5f0492e8fe7d9dc62c6db7eed2012dc2d029cdc2c27503eb3e'
AND (
token = 'uUZYGOWd1WoTs5A1WqWXYUUOa0pa5dyM2kK9My1NmS4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)