UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'w7cWSs/jmCLYORiuNkE2akiHVHqKuKSxWsErMXRZgv4='
WHERE
key_id = 'bd2ed3c20dc301f2e211fe1b006344bb106251372d6ecd71288c145f3b9638b0'
AND (
token = 'w7cWSs/jmCLYORiuNkE2akiHVHqKuKSxWsErMXRZgv4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)