UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xEIglHjq3TR7n+1gxxm7oOmRTpzTCC+O/m7ed9uaJz8='
WHERE
key_id = '9633582dd92660628dfe2b8c6bf790762fd526490e6297331253abbe46547c2e'
AND (
token = 'xEIglHjq3TR7n+1gxxm7oOmRTpzTCC+O/m7ed9uaJz8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)