UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lkIpDI9ojQA7YdrTGLZN1qRnm/Mw65JcUmMfGMGuN6w='
WHERE
key_id = '0e5a1245ed974b8caa5b6044c4839b4321096033421e9414759c5811aec53a8a'
AND (
token = 'lkIpDI9ojQA7YdrTGLZN1qRnm/Mw65JcUmMfGMGuN6w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)