UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FXA19dxMwI0y+LB1ZepyDO0kgOdktN7H76D6c+pyzFQ='
WHERE
key_id = '4160fb0a275d64b69802da2fa167b734ab281acf785a5b79ed4b8e7090f0e9a2'
AND (
token = 'FXA19dxMwI0y+LB1ZepyDO0kgOdktN7H76D6c+pyzFQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)