UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ItMQgyXwUa8x9AWlP1sHAMa1tUskqT0fdNrGSJ9hya8='
WHERE
key_id = '96bd2781a266862e39755f84b09a5fc1ad7e667ceb1c64b46dbac7c8efdea142'
AND (
token = 'ItMQgyXwUa8x9AWlP1sHAMa1tUskqT0fdNrGSJ9hya8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)