UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RHBAd83WyClygobFzKD3CovEFx/MF7IWokOJ7p9Y97s='
WHERE
key_id = '622a2321a6c1962b2a6c320dab30f60a27791bbb9a88bf0438dd60f78cf5ced2'
AND (
token = 'RHBAd83WyClygobFzKD3CovEFx/MF7IWokOJ7p9Y97s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)