UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vPNRD9XaNa3I2OcZNv7knQOkaeSJkVqD71MDa1tIl+c=' 
WHERE 
  key_id = '25b623f3e044892c45289706e31a8ed8e9e5ca2be8f341fec2c9b125b49a7b3a' 
  AND (
    token = 'vPNRD9XaNa3I2OcZNv7knQOkaeSJkVqD71MDa1tIl+c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029