UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o6Gj5KCiHVS8Tzc3gSCjVdAU8zLnNYfu7CM03+xNXAo='
WHERE
key_id = '059708685f97e4ee872c1ccba156fe4d18f32b229a580ad41bb4761c9a08be8f'
AND (
token = 'o6Gj5KCiHVS8Tzc3gSCjVdAU8zLnNYfu7CM03+xNXAo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)