UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5dFR/MPMYr4lLEkakQgIUx7fnNy8UuhcsA2M7g5V5IE='
WHERE
key_id = '9bd369e452ee3aae2488829411e35d0e6d99d931fb0404aa92a23582f8aba68c'
AND (
token = '5dFR/MPMYr4lLEkakQgIUx7fnNy8UuhcsA2M7g5V5IE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)