UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aMssCQZyvP/Y1SPRiqjjgb3Egn3csHtduqrdKpO7FCI='
WHERE
key_id = '859a16ae116d0d33e5817ffc24b2e7d06a9858a7403904a33ece1622bf605e2a'
AND (
token = 'aMssCQZyvP/Y1SPRiqjjgb3Egn3csHtduqrdKpO7FCI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)