UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '29XVPKhJjtGmFF130YLpSl2zEihw/WJvJyg5AHlrRck='
WHERE
key_id = 'af70dcb362d037c552c4d05c65e79ee1650396ff0a4cbdc23cafc4c27a0b83eb'
AND (
token = '29XVPKhJjtGmFF130YLpSl2zEihw/WJvJyg5AHlrRck='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)