UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8HNg0LWBiE8lF1BeUdusgN3Wl/+0CoyXAL+ZctiZlv4='
WHERE
key_id = 'cf57d5e2cae9ede8fcc6456ab3c86d2a559eed6db5afd6efce3ad97d1ea8dc04'
AND (
token = '8HNg0LWBiE8lF1BeUdusgN3Wl/+0CoyXAL+ZctiZlv4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)