UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Lt4kWoRrX1F1ZISptB6+4FaVIOuc9bOJGR52J10SymI='
WHERE
key_id = '56ff4def87b080a01744611375aa784552ecd62572a8ed1a44c85fffd54df1dd'
AND (
token = 'Lt4kWoRrX1F1ZISptB6+4FaVIOuc9bOJGR52J10SymI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)