UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Nd0vVwk9EVIsbj3A4QOcXuYoZiRTPR/Q2f6V2wVP+f0='
WHERE
key_id = '9f5c0b65fb706c2b0c6760f1642835db3b8fe0950b3a7a32ffc36fc7fe0eb46d'
AND (
token = 'Nd0vVwk9EVIsbj3A4QOcXuYoZiRTPR/Q2f6V2wVP+f0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)