UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+ovFs0ebLYV3AvaKxOox3Lad1/mW+cMWqQuDNW1naxw='
WHERE
key_id = 'e79f94869c23592ec9fc0a5a9bc23d0a064835cfc9b0db974f4b8d0206fc0813'
AND (
token = '+ovFs0ebLYV3AvaKxOox3Lad1/mW+cMWqQuDNW1naxw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)