UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kX3Zt/XrwBVw2WZ34weFSl/yzuCPTg90Vy7qHiagmuM='
WHERE
key_id = '2685212c66906e986c0874753b657170916273f828c237e6e1977c881aaa5608'
AND (
token = 'kX3Zt/XrwBVw2WZ34weFSl/yzuCPTg90Vy7qHiagmuM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)