UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0z4MlrFNxh0GVE4smmcKMAaiHFWbVi8BOUfCWIi1qQ4='
WHERE
key_id = 'bc2ebbe283d3393a67b6cb746d399eeddfc35caa3eee2a3b32c8e75faa2cfdc1'
AND (
token = '0z4MlrFNxh0GVE4smmcKMAaiHFWbVi8BOUfCWIi1qQ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)