UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DPY3Gl722owzG+OLMWg+CUS58b1wrcZFNAOrlwFuApI='
WHERE
key_id = '51aecc75e3efe9529fd85d3785ab9f13e2ecfb1384f6c46ca7a0c147c59f4ca9'
AND (
token = 'DPY3Gl722owzG+OLMWg+CUS58b1wrcZFNAOrlwFuApI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)