UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VkTIM3LdQToDCvIB/mtviM/wmjCvhIzbo5xtW1EyR98='
WHERE
key_id = 'e2cd9cf28e67a55c1faf6ed5b6c3a589b315291557417fa38172d0216f8eab53'
AND (
token = 'VkTIM3LdQToDCvIB/mtviM/wmjCvhIzbo5xtW1EyR98='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)