UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pT7F60u1f1WHeaZhzCoSITMbZecc/RdxGDRfEqPfQrw='
WHERE
key_id = 'ca7b12ebe622aabbc77bd23e4eeff633365e249cd16ef05d62e1e01f5584349c'
AND (
token = 'pT7F60u1f1WHeaZhzCoSITMbZecc/RdxGDRfEqPfQrw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)