UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D/cT7a7D5RLsYcMJnMl9+Odg5LcebWBi5mY9us4gVRg='
WHERE
key_id = 'cd062f35fc4bfcb2a25c08f3ec21ffb2fd11a7d7808db8ac5e57be549142ba5e'
AND (
token = 'D/cT7a7D5RLsYcMJnMl9+Odg5LcebWBi5mY9us4gVRg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)