UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'd+abLf373kVSgYclb0URfwdY1aiVCk19hzC8HBXjOrw='
WHERE
key_id = '143e4f851f0aa7ec5b18f4841ddb6cb28614ea809d6deba1d49db69f1292f7ba'
AND (
token = 'd+abLf373kVSgYclb0URfwdY1aiVCk19hzC8HBXjOrw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)